load("//eden/scm:targets.bzl", "rust_python_library")

oncall("sapling")

rust_python_library(
    name = "cmdpy",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {
        "cargo_toml_config": {
            "dependencies_override": {
                "dependencies": {
                    "bindings": {
                        "default-features": False,
                    },
                },
            },
            "extra_buck_dependencies": {
                "build-dependencies": ["//eden/scm/lib/util/python-sysconfig:python-sysconfig"],
            },
            "features": {
                "default": [],
                "fb": [],
            },
        },
    },
    crate_root = "src/lib.rs",
    features = [
        "fb",
    ],
    include_python_sys = True,
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:libc",
        "fbsource//third-party/rust:tracing",
        "//eden/scm/lib/clidispatch:clidispatch",
        "//eden/scm/lib/commandserver:commandserver",
        "//eden/scm/lib/config/model:configmodel",
        "//eden/scm/lib/context:context",
        "//eden/scm/lib/cpython-ext:cpython-ext",
        "//eden/scm/lib/hook:hook",
        "//eden/scm/lib/python-modules:python-modules",
        "//eden/scm/lib/util/factory:factory",
        "//eden/scm/lib/util/nodeipc:nodeipc",
        "//eden/scm/saplingnative/bindings:bindings",
        "//eden/scm/saplingnative/bindings/modules/pycontext:pycontext",
        "//eden/scm/saplingnative/bindings/modules/pyhook:pyhook",
        "//eden/scm/saplingnative/bindings/modules/pyio:pyio",
        "//eden/scm/saplingnative/bindings/modules/pymodules:pymodules",
    ],
)
